package com.fyzs.mp3recorder.wav

import org.junit.Assert.*
import org.junit.Before

import org.junit.Test

class Pcm2WavTest {


    lateinit var pcm2Wav: Pcm2Wav
    @Before
    fun setUp(){
        pcm2Wav = Pcm2Wav()
    }


    @Test
    fun littleEndianInt() {

        //测试  Int类型  大端转小端
        val littleEndian= arrayOf(
            byteArrayOf(1,0,0,0),//1
            byteArrayOf(2,0,0,0),//2
            byteArrayOf(3,0,0,0),//3
            byteArrayOf(4,0,0,0),//4
        )
        val bigEndian= arrayOf(
            1,//1
            2,//2
            3,//3
            4,//4
        )

        for (i in 0 until bigEndian.size) {
            val actraly = pcm2Wav.littleEndianInt(bigEndian[i])
            for (j in 0 until littleEndian.size) {
                assert(actraly[j]==littleEndian[i][j])
            }
        }



    }

    @Test
    fun littleEndianShort() {
    }
}